package com.xpsoft.oa.dao.project.impl;


import java.util.List;

import org.hibernate.Query;

import com.xpsoft.core.dao.impl.BaseDaoImpl;
import com.xpsoft.oa.dao.project.ProjectDesignRegInfoDao;
import com.xpsoft.oa.model.project.ProjectDesignRegInfo;

public class ProjectDesignRegInfoDaoImpl extends BaseDaoImpl<ProjectDesignRegInfo> implements ProjectDesignRegInfoDao{

	public ProjectDesignRegInfoDaoImpl() {
		super(ProjectDesignRegInfo.class);
	}

	@Override
	public void deleteProjectDesignRegInfos(Long regId, List<Long> idList) {
		// TODO Auto-generated method stub
		String hql = "delete from ProjectDesignRegInfo where id not in (:ids) and projectDesignReg.id=:regId";
		Query query =  getSession().createQuery(hql);
		query.setParameterList("ids", idList).setParameter("regId", regId);
		query.executeUpdate();
	}

}